package com.zm.demo.core.leetcode;

public class maxArea {
    public int maxArea(int[] height) {

//        int [][] r = new int[height.length-1][];
        int max = 0;
        for (int i = 0 , j=height.length-1; i < j;) {
            max = Math.max(max, Math.min(height[i]*height[j], (j-1)));
            if (height[i] >= height[j]){
                i++;
            }else if (height[i] < height[j]){
                j--;
            }

        }
        return max;


    }
}